<?php
namespace Test\Controller;

use Think\Controller;

class IndexController extends Controller
{

    public function indexAction()
    {
        $name = 'user_' . time();
        $channel = new \SaeChannel();
        $channel->sendMessage($name, 'welcome');
        
        $this->channelUrl = $channel->createChannel($name);
        $this->display();
    }

    public function create_guid()
    {
        $charid = strtoupper(md5(uniqid(mt_rand(), true)));
        $uuid = substr($charid, 0, 8) . substr($charid, 8, 4) . substr($charid, 12, 4) . substr($charid, 16, 4) . substr($charid, 20, 12);
        return $uuid;
    }
}